<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@  taglib uri="http://java.sun.com/jsp/jstl/core"   prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>手把手教学视频官网</title>
<link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
	<div class="layui-header">
		<div class="layui-logo">手把手教学视频管理系统</div>
			
<!-- 			左边菜单栏区域 -->
			<ul class="layui-nav layui-layout-right">
<!-- 			视频上传功能：通过超链接跳转到MajorServlet页面获得所有专业再跳转到upload.jsp -->
			<li class="layui-nav-item"><a target="main" href="MajorServlet?method=info"  id="upload">上传视频</a></li>
				<li class="layui-nav-item">
					<a href="javascript:;"> 
						<img src="http://t.cn/RCzsdCq" class="layui-nav-img">
						用户名
					</a>
					<dl class="layui-nav-child">
						<dd><a href="">基本资料</a></dd>
						<dd><a href="">修改密码</a></dd>
					</dl>
				</li>
				<li class="layui-nav-item"><a href="">退出系统</a></li>
			</ul>
		</div>

	<div class="layui-side layui-bg-black">
		<div class="layui-side-scroll">
			<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
			<ul class="layui-nav layui-nav-tree" lay-filter="test">
				<!-- 要明白FOR循环里面的对应值之间的转换,这里主要获取的就是${u.userName } -->
				<c:forEach var="m" items="${majorInfo }">
					<li class="layui-nav-item ">
						<a class="" href="javascript:;">${m.majorName }</a><!-- 一级菜单 -->
							<dl class="layui-nav-child"><!-- 二级菜单 -->
								<c:forEach var="u" items="${ userInfo}">
								<%-- 注意:这里m.majorId == u.userMajor都是int类型,这里是两张表一一对应,查看数据库 --%>
									<c:if test="${m.majorId == u.userMajor }">
										<%-- target 属性规定在何处打开 action URL。这里超链接到VideoServlet --%>
										<%-- 通过点击${u.userId }标签得到与之对应的id值 --%>
										<dd><a target="main" href="VideoServlet?method=info&userId=${u.userId }">${u.userName }</a></dd>
									</c:if>
								</c:forEach>
							</dl></li>
				</c:forEach>
				</ul>
		</div>
	</div>

	<div class="layui-body">
	<!-- 内容主体区域 -->
		<iframe name="main" src="main.jsp" width="100%" height="99.9%" frameborder="1"> </iframe>
	</div>
		
	<div class="layui-footer">
			<!-- 底部固定区域 -->
			© video.com
	</div>
</div>
	<script src="layui/layui.js"></script>
	<script>
		//JavaScript代码区域
		layui.use('element', function() {
			var element = layui.element;

		});
	</script>
</body>
</html>